/**
 * 
 */
package com.chacha.utils;

import java.util.Properties;

import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 * @author fujitzu
 *
 */
public class ConnectionService {

	private InitialContext initialContext;
	
	public ConnectionService(){
		Properties props = new Properties();

		// optional.  Defaults to localhost.  Only needed if web server is running
	    // on a different host than the appserver    
	    props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
//	    props.setProperty("org.omg.CORBA.ORBInitialHost", "192.168.1.74");

	    // optional.  Defaults to 3700.  Only needed if target orb port is not 3700.
	    props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");

	    try {
	    	initialContext = new InitialContext(props);
		} catch (NamingException e) {
			e.printStackTrace();
		}
	}

	public InitialContext getInitialContext() {
		return initialContext;
	}
	
}
